#ifndef HH_CAM_CONTROL_IMPL_H
#define HH_CAM_CONTROL_IMPL_H

#include "cam_control_interface.hpp"
#include <unordered_map>
#include <string>

static std::vector<cam_control_interface::caminfo> globalCamInfo;

class cam_control_impl: public cam_control_interface{
    public:
        caminfo getLastCamInfo() override;
        caminfo findCamInfo(const char *) override;
        std::vector<caminfo> getGlobalCamInfo() override;
        // void initGlobalCamInfo(caminfo *);
        int addCamInfo(caminfo) override;
        int delCamInfo(const char *) override;
        caminfo findCamInfoBynPort(int &) override;
        caminfo camwarp2caminfo(caminfowrap &) override;
        int add_cam_stream(std::string) override;
        std::vector<caminfo> get_ptr_from_list(std::vector<std::string> camid_list) override;
        int set_guserid(const char *camId, const int guserid) override;
        int set_gnport(const char *camId, const int gnport) override;
        std::string release_ver(){ return "0.0.1";}

        bool CaptrueImgNew(const char* camId,const char * filename) override;
        void PtzControl(const char *camId,const int &pan,const int &tilt,const int &zoom,const int &action) override;
        int InitCam(const caminfo info) override;
        bool SaveVideoFile(const char* camId,const char * filename,unsigned long videoTime) override;
        void StartGetStream(caminfo &cam) override;
        camptz<int,int,int> get_ptz(const char *) override;
        void Disconnect(caminfo &cam) override;
        void StartConnect(caminfo &cam) override;
        int man_control(const char *camId, const int camSpeed, const int cmd, const int motion) override;
        void set_ptz(const char *,camptz<int,int,int> &&,int action) override;  
        int set_last_ptz(const char *camId,camptz<int,int,int> &ptz) override;
        const camptz<int,int,int> *get_last_ptz(const char *camId) override;

    private:
        void SdkInit();
        bool sdkIsInit=false; 
        std::unordered_map<const char*,camptz<int,int,int>> camInfoMap;
};

#endif